#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 crane <crane@gosun>
#
# Distributed under terms of the MIT license.

"""

"""

m = {}

def f(n):
    if n in [0, 1]:
        return 1

    if n == 2:
        return 2

    if n in m:
        return m[n]

    res = f(n-1) + f(n-2) + f(n-3)
    m[n] = res
    return res



def main():
    print("start main")
    print(f(15))

if __name__ == "__main__":
    main()
